package com.abocode.aichat.app.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.SimpleDateFormat;
import java.util.Date;

/***
 * Created by guanxf on 2015/12/16.
 */
@Controller
public class TimeController {
	@RequestMapping(value = { "/getlocaltime", "/" }, method = RequestMethod.POST)
	public @ResponseBody
	long getlocaltime() {
		return new Date().getTime();
	}
	@RequestMapping(value = { "/gettimestr", "/" }, method = RequestMethod.POST)
	public @ResponseBody String gettimestr() {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return sdf.format(new Date());
	}
}
